import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../pages/Home/Home.vue'
import Chat from '../pages/Chat/Chat.vue'
import Me from '../pages/Me/Me.vue'
import Tuijian from '../pages/Tuijian/Tuijian.vue'
import Search from '../pages/Search/Search.vue'
import Login from '../pages/Login/login.vue'

import Hot from '../pages/Home/Children/Hot/hot.vue'
import baihuo from '../pages/Home/Children/baihuo.vue'
import dianqi from '../pages/Home/Children/dianqi.vue'
import fushi from '../pages/Home/Children/fushi.vue'
import nanzhuang from '../pages/Home/Children/nanzhuang.vue'
import neiyi from '../pages/Home/Children/neiyi.vue'
import shipin from '../pages/Home/Children/shipin.vue'
import xiebao from '../pages/Home/Children/xiebao.vue'

//声明使用
Vue.use(VueRouter)

//输出路由对象
export default new VueRouter({
    //配置一级路由
    routes: [{
            path: '/',
            name: 'Home',
            component: Home,
            meta: { showBottomTabbar: true }
        },
        {
            path: '/home',
            name: 'Home',
            component: Home,
            //二级路由
            children: [
                // 热门版块
                { path: 'hot', name: 'Hot', component: Hot, meta: { showBottomTabbar: true } },
                // 服饰版块
                { path: 'fushi', name: 'fushi', component: fushi },
                // 鞋包版块
                { path: 'xiebao', name: 'xiebao', component: xiebao },
                // 百货版块
                { path: 'baihuo', name: 'baihuo', component: baihuo },
                // 食品版块
                { path: 'shipin', name: 'shipin', component: shipin },
                // 内衣版块
                { path: 'neiyi', name: 'neiyi', component: neiyi },
                // 男装版块
                { path: 'nanzhuang', name: 'nanzhuang', component: nanzhuang },
                // 电器版块
                { path: 'dianqi', name: 'dianqi', component: dianqi },
                { path: '/home', redirect: '/home/Hot' }
            ]
        },
        {
            path: '/chat',
            name: 'Chat',
            component: Chat,
            meta: { showBottomTabbar: true }
        },
        {
            path: '/me',
            name: 'Me',
            component: Me,
            meta: { showBottomTabbar: true }
        },

        {
            path: '/login',
            name: 'login',
            component: Login
        },

        {
            path: '/tuijian',
            name: 'Tuijian',
            component: Tuijian,
            meta: { showBottomTabbar: true }
        },
        {
            path: '/search',
            name: 'Search',
            component: Search,
            meta: { showBottomTabbar: true }
        },
        {
            path: '/',
            name: 'home',
            redirect: '/Home'
        }
    ]
})